package com.qf.controller;

import com.qf.pojo.User;
import com.qf.service.UserService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @Autowired
    private HttpServletRequest request;
    Logger logger= Logger.getLogger(UserController.class);
    @RequestMapping("/test1")
    public String test1(Model model){
        logger.debug("========debug信息===========");
        List<User> userAll = userService.findUserAll();
        model.addAttribute("users",userAll);
        return "user";
    }
}
